package com.ytjj.qmyx.users.enums;

import lombok.Getter;

/**
 * @Description 用户年龄枚举
 * @ClassName UserAgeEnums
 *
 * 
 * @Version 1.0
 **/
@Getter
public enum UserAgeEnums {
    ZERO("0", "0-25岁"),
    ONE("1", "0-25岁"),
    TWO("2", "26-30岁"),
    THREE("3", "41-45岁"),
    FOUR("4", "51-55岁")
    ;

    /**
     * code值
     */
    private String code;
    /**
     * 年龄段
     */
    private String ageRange;

    UserAgeEnums(String code, String ageRange) {
        this.code = code;
        this.ageRange = ageRange;
    }

    /**
     * @Description 获取年龄段数据
     *
     *
     * 
     */
    public static String getAgeRange(String code) {
        for (UserAgeEnums userAge : UserAgeEnums.values()) {
            if(userAge.getCode().equals(code)) {
                return userAge.getAgeRange();
            }
        }
        return null;
    }



}
